import axios from 'axios'
import { ElMessage } from 'element-plus'
const myAxios = axios.create({
    baseURL:'/api',
    timeout:2000
})

myAxios.interceptors.request.use(config =>{
    return config
})

myAxios.interceptors.response.use( 
    response =>{
        return response.data
    },
    error =>{
        //中断
        ElMessage.error('获取资源失败')
        return new Promise(()=>{})
    }
)

export default myAxios